package top.xcxdl.rural.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author Ding
 * @since 2022-05-22
 */
@Data
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
@EqualsAndHashCode(callSuper = false)
public class RuralCourseUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 课程、章节、课节（视频、测验）与用户的关联主键id
     */
    @TableId(value = "course_user_id", type = IdType.AUTO)
    private Integer courseUserId;

    /**
     * 课程、章节、课节（视频、测验）外键id
     */
    private Integer courseId;

    /**
     * 用户外键id
     */
    private Integer userId;

    /**
     * 是否通过（0否，1是）
     */
    private Integer isPass;

    /**
     * <仅当类型为课节的视频时才记录>  用户观看时长（秒）
     */
    private Integer watchTime;

    /**
     * <仅当类型为课节的测验时才记录>  用户答题情况
     */
    private String answer;

    /**
     * 创建时间（10位时间戳）
     */
    private String createTime;

    /**
     * 修改时间（10位时间戳）
     */
    private String updateTime;

    @TableField(exist = false)
    private Integer isJoin;

    @TableField(exist = false)
    private Double userScore;

    @TableField(exist = false)
    private JSONObject userAnswerBody;

    @TableField(exist = false)
    private Double passScore;

    @TableField(exist = false)
    private Double totalScore;

    public static abstract class PassCode {
        public final static int PASS = 1;
        public final static int FAIL = 0;
    }
}
